#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
struct TIME
{
    int hh;
    int mm;
} T, ZhongZhuan;
int main()
{
    int s, v;
    cin >> s >> v;
    int time;
    T.hh = 7, T.mm = 50;
    //time = (s > v) ? s / v + 1 : 1;
    if (s > v)
    {
        time = (s % v == 0) ? (s / v) : (s / v + 1);
    }
    else
    {
        time = 1;
        cout << T.hh << ":" << T.mm - time << endl;
        return 0;
    }
    ZhongZhuan.hh = time / 60;
    ZhongZhuan.mm = time % 60;
    if (T.mm - ZhongZhuan.mm < 0)
    {
        T.mm += 60;
        T.mm = T.mm - ZhongZhuan.mm;
        ZhongZhuan.hh += 1;
    }
    else
    {
        T.mm = T.mm - ZhongZhuan.mm;
    }
    if (T.hh - ZhongZhuan.hh < 0)
    {
        T.hh += 24;
        T.hh = T.hh - ZhongZhuan.hh;
    }
    else
    {
        T.hh = T.hh - ZhongZhuan.hh;
    }

    if (T.mm == 60)
    {
        T.mm = 0;
        if (T.hh > 0)
        {
            T.hh--;
        }
        else
        {
            T.hh += 24;
            T.hh--;
        }
    }
    printf("%02d:%02d", T.hh, T.mm);

    return 0;
}